package org.flexlancer.Logger
{
	import mx.controls.Alert;
	
	public class Logger
	{
		public static function Log(message:String):void{
			try{
				var dtNow:Date = new Date();
				var dispString:String = "["+dtNow.toString()+"] "+message+"\n";
				trace(dispString);
			}catch(err:Error){
				trace("Error in Logger.Log");
			}
		}
		public static function LogE(err:Error, message:String = ""):void{
			try{
				var msg:String = "--- EXCEPTION ---\n";
				if (message != "" ){
					msg += "{"+message+"}\n";
				}
				msg += err.message + "\n" + err.getStackTrace();
				Logger.Log(msg);
				Alert.show(msg,"EXCEPTION");
			}catch(err:Error){
				trace("Error in Logger.LogE");
			}
		}
	}
}